/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package jp.co.irep.juten.entity;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.validation.constraints.NotNull;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author toan_nguyen
 */
@Entity
@Table(name = "order_tbl")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "OrderTbl.findAll", query = "SELECT o FROM OrderTbl o"),
    @NamedQuery(name = "OrderTbl.findByNo", query = "SELECT o FROM OrderTbl o WHERE o.no = :no"),
    @NamedQuery(name = "OrderTbl.findByMakerNo", query = "SELECT o FROM OrderTbl o WHERE o.makerNo = :makerNo"),
    @NamedQuery(name = "OrderTbl.findByOrderNo", query = "SELECT o FROM OrderTbl o WHERE o.orderNo = :orderNo")})
public class OrderTbl implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "no")
    private Integer no;
    @Basic(optional = false)
    @NotNull
    @Column(name = "maker_no")
    private int makerNo;
    @Basic(optional = false)
    @NotNull
    @Column(name = "order_no")
    private int orderNo;

    public OrderTbl() {
    }

    public OrderTbl(Integer no) {
        this.no = no;
    }

    public OrderTbl(Integer no, int makerNo, int orderNo) {
        this.no = no;
        this.makerNo = makerNo;
        this.orderNo = orderNo;
    }

    public Integer getNo() {
        return no;
    }

    public void setNo(Integer no) {
        this.no = no;
    }

    public int getMakerNo() {
        return makerNo;
    }

    public void setMakerNo(int makerNo) {
        this.makerNo = makerNo;
    }

    public int getOrderNo() {
        return orderNo;
    }

    public void setOrderNo(int orderNo) {
        this.orderNo = orderNo;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (no != null ? no.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof OrderTbl)) {
            return false;
        }
        OrderTbl other = (OrderTbl) object;
        if ((this.no == null && other.no != null) || (this.no != null && !this.no.equals(other.no))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "jp.co.irep.tech.juten.entity.OrderTbl[ no=" + no + " ]";
    }
    
}
